package com.example.module_marketers.model

import com.bw.lib_common.entity.Res
import com.bw.lib_common.model.BaseRepository
import com.bw.lib_http.OkHttpClientManager
import com.example.module_marketers.api.MarketersApiService
import com.example.module_marketers.entity.*

class MarketersRepository:BaseRepository<MarketersApiService>() {
    override fun createApiServer(): MarketersApiService=OkHttpClientManager.retrofitInstance.create(MarketersApiService::class.java)
    suspend fun getBusinessProfileList(): Res<BusinessProfileEntity> {
        return createApiServer().getBusinessProfileList()
    }
    suspend fun getBusinessProfileDetailById(id:Int): Res<BusinessProfileEntityItem> {
        return createApiServer().getBusinessProfileDetailById(id)
    }
    suspend fun getResidencyApplicationList(): Res<ResidencyApplicationEntity> {
        return createApiServer().getResidencyApplicationList()
    }
    suspend fun addResidencyApplication(residencyApplicationEditEntity: ResidencyApplicationEditEntity): Res<ResidencyApplicationEntityItem> {
        return createApiServer().addResidencyApplication(residencyApplicationEditEntity)
    }
    suspend fun getResidencyApplicationDetailById(id:Int): Res<ResidencyApplicationEntityItem> {
        return createApiServer().getResidencyApplicationDetailById(id)
    }
    suspend fun approveResidencyApplication(id:Int): Res<ResidencyApplicationEntityItem> {
        return createApiServer().approveResidencyApplication(id)
    }
}